package com.xb.cloud.product.merchant.service.client.bo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.mongodb.morphia.annotations.Embedded;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.Property;
/**
 * 产品存储在mongo中的数据结构， id为单品的id或者系列品虚品的id 
 * @author kexue
 *
 */
@Entity(value = "xb_product", noClassnameStored = true)
public class ProductMongoBo implements Serializable {
	private static final long serialVersionUID = 2991580255089179287L;
	/**
	 * 单品id或者系列品虚品Id;
	 */
	@Id
	private Long id;
	
	@Property("companyId")
	private Long companyId;
	
	@Property("merchantId")
	private Long merchantId;
	
	@Property("categoryId")
	private Long categoryId;
	
	//产品名称
	@Property("productNameCn")
	private String  productNameCn;
	
	//产品类型0：普通产品 1：系列品 （虚品） 
	@Property("productType")
	private Byte  productType; 

	//基础属性列表，单品和系列品公用
	@Embedded
	private List<ProductAttributeMongoBo> baseAttrs = new ArrayList<ProductAttributeMongoBo>();

	//系列属性列表，系列品私有
	@Embedded
	private List<ProductAttributeMongoBo> seriesAttrs = new ArrayList<ProductAttributeMongoBo>();
	
	
	/**  (发布sku，选中系列品某种组合，对应的子品id)
	 *    系列属性key_value组合作为map的key , map的value是product Id
		  1-1_2-1 (红色 * 10cm) =>productId1
		  1-1_2-2 (红色 * 20cm) =>productId2
		  2-1_2-1 (黄色 * 10cm) =>productId3
		  2-1_2-2 (黄色 * 20cm) =>productId4
	 */
	@Embedded
	private Map<String,Long> seriesAttributeCombProductIdMap=new HashMap<String,Long>();
	
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	public Long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	public Long getMerchantId() {
		return merchantId;
	}

	public void setMerchantId(Long merchantId) {
		this.merchantId = merchantId;
	}

	public List<ProductAttributeMongoBo> getBaseAttrs() {
		return baseAttrs;
	}

	public void setBaseAttrs(List<ProductAttributeMongoBo> baseAttrs) {
		this.baseAttrs = baseAttrs;
	}

	public List<ProductAttributeMongoBo> getSeriesAttrs() {
		return seriesAttrs;
	}

	public void setSeriesAttrs(List<ProductAttributeMongoBo> seriesAttrs) {
		this.seriesAttrs = seriesAttrs;
	}

	public Map<String, Long> getSeriesAttributeCombProductIdMap() {
		return seriesAttributeCombProductIdMap;
	}

	public void setSeriesAttributeCombProductIdMap(Map<String, Long> seriesAttributeCombProductIdMap) {
		this.seriesAttributeCombProductIdMap = seriesAttributeCombProductIdMap;
	}
//
//	public Map<String, Long> getProductIdShopIdCombSkuIdMap() {
//		return productIdShopIdCombSkuIdMap;
//	}
//
//	public void setProductIdShopIdCombSkuIdMap(Map<String, Long> productIdShopIdCombSkuIdMap) {
//		this.productIdShopIdCombSkuIdMap = productIdShopIdCombSkuIdMap;
//	}

	public Byte getProductType() {
		return productType;
	}

	public void setProductType(Byte productType) {
		this.productType = productType;
	}

	public String getProductNameCn() {
		return productNameCn;
	}

	public void setProductNameCn(String productNameCn) {
		this.productNameCn = productNameCn;
	}
	 
}
